﻿@namespace MduiBlazor
@inherits MduiInputBase<string>

<div class="@Classname" style="@Style" @attributes="@AdditionalAttributes">
    <MduiIconButton Class="mdui-field-icon" DisableRipple OnClick="@ToggleAsync">
        @if (IconContent is not null)
        {
            @IconContent
        }
        else
        {
            <MduiIcon Icon="@Icon" />
        }
    </MduiIconButton>
    <input @ref="@Element" class="mdui-input" type="@Type" pattern="@Pattern" maxlength="@MaxLength"
        placeholder="@Placeholder" disabled="@Disabled" readonly="@Readonly"
        value="@BindConverter.FormatValue(CurrentValueAsString)"
    @onchange="@(EventCallback.Factory.CreateBinder<string?>(this, __value => CurrentValueAsString = __value, CurrentValueAsString))"
    @onfocus="@OnInputFocus" @onblur="@OnInputBlur" />
    <MduiIconButton DisableRipple Class="mdui-field-close" Icon="close" OnClick="@ToggleAsync" />
 </div>
